﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="vote.ascx.cs" Inherits="AnyOffice.general.mytable.vote" %>
<script>
function open_vote(vote_id)
{
 URL="/general/vote/show/read_vote.aspx?vote_id="+vote_id;
 myleft=(screen.availWidth-500)/2;
 window.open(URL,"read_vote","height=300,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
</script>
<div id="module_7" style="position: relative;padding-bottom:10px;">
<table class="TableBlock" width="100%" cellspacing="0" cellpadding="2">
  <tr class="TableHeader">
    <td id="module_7_head" class="TableHeader" width="70%">
		<img src="/images/menu/vote.gif" align="absMiddle"> 投票
	</td>
	<td id="module_7_more" align="right">
		<div id="module_7_op" style="float:right;display:none;">>&nbsp;</div>
		<div style="float:right">&nbsp;</div>
	</td>
  </tr>
  <tr class="TableData"  style="background:#FFFFFF url(/images/water/vote.jpg) no-repeat bottom right">
    <td colspan="2" height="60">
    <div id="divVote">
    <asp:Repeater id="rptVote" runat="server" EnableViewState="False">
	<ItemTemplate>
	·<a href="javascript:open_vote(<%#DataBinder.Eval(Container.DataItem,"VoteId")%>);"><%#DataBinder.Eval(Container.DataItem,"Subject")%></a>
	<br>
	</ItemTemplate>
	</asp:Repeater>
	<asp:Literal id="litVote" runat="server"></asp:Literal>
	</div>
    </td>
  </tr>
</table>
</div>
<SCRIPT language="javascript">
CODE_IDSTR += "11,";
var timer_vote = null;
var str_vote = "";
function GetVote()
{	
	if(timer_vote != null)
		window.clearTimeout(timer_vote);
		
	AnyOffice.general.mytable.AjaxMethods.GetVote(CallBack_GetVote);
	timer_vote=setTimeout("GetVote()",AJAX_INTERVAL*10);
}
function CallBack_GetVote(res)
{	
	if (res.error != null)
		return;
					
	if(str_vote != res.value)
		document.getElementById('divVote').innerHTML = res.value;		
	str_vote = res.value;	
}
GetVote();
</SCRIPT>

